// 微信小程序内嵌h5，跳转到原生空白页拉起支付
export class MiniProgramPayment {
  pay(payInfoObj) {
    const blankUrl = payInfoObj.blankUrl || "/page/pay/pay_page/pay_page";
    return new Promise((resolve, reject) => {
      try {
        wx.miniProgram.navigateTo({
          url: `${blankUrl}?payConfig=${window.btoa(
            JSON.stringify(payInfoObj)
          )}`,
        });
        resolve();
      } catch (error) {
        reject(error);
      }
    });
  }
}
